package tables

import (
	"github.com/GoAdminGroup/go-admin/context"
	"github.com/GoAdminGroup/go-admin/modules/db"
	"github.com/GoAdminGroup/go-admin/plugins/admin/modules/table"
	"github.com/GoAdminGroup/go-admin/template/types/form"
)

// GetAlipayMiniApp return the model of table alipay_mini_app.
func GetAlipayMiniApp(ctx *context.Context) (stTable table.Table) {

	config := table.DefaultConfigWithDriver("postgresql")

	stTable = table.NewDefaultTable(config)

	info := stTable.GetInfo()
	info.AddField("ID", "id", db.Int)
	info.AddField("应用ID", "app_id", db.Varchar)
	info.AddField("应用名称", "app_name", db.Varchar)
	info.AddField("应用英文名", "app_english_name", db.Varchar)
	info.AddField("应用标语", "app_slogan", db.Varchar)
	info.AddField("应用标示", "app_logo", db.Varchar)
	info.AddField("应用类目", "mini_category_ids", db.Varchar)
	info.AddField("服务电话", "service_phone", db.Varchar)
	info.AddField("应用描述", "app_desc", db.Varchar)
	info.AddField("营业执照编号", "license_no", db.Varchar)
	info.AddField("营业执照名称", "license_name", db.Varchar)
	info.AddField("营业执照照片", "license_pic", db.Varchar)
	info.AddField("营业执照有效期", "license_valid_date", db.Varchar)
	info.AddField("门头照", "out_door_pic", db.Varchar)
	info.AddField("特殊资质照片", "special_license_pic", db.Varchar)

	info.SetTable("alipay_mini_app").SetTitle("支付宝小程序资料").SetDescription("支付宝小程序资料")

	formList := stTable.GetForm()
	formList.AddField("ID", "id", db.Int, form.Text)
	formList.AddField("AppID", "app_id", db.Varchar, form.Text)
	formList.AddField("应用名称", "app_name", db.Varchar, form.Text)
	formList.AddField("应用英文名", "app_english_name", db.Varchar, form.Text)
	formList.AddField("应用标语", "app_slogan", db.Varchar, form.Text)
	formList.AddField("应用标示", "app_logo", db.Varchar, form.Text)
	formList.AddField("应用类目", "mini_category_ids", db.Varchar, form.Text)
	formList.AddField("服务电话", "service_phone", db.Varchar, form.Text)
	formList.AddField("应用描述", "app_desc", db.Varchar, form.Text)
	formList.AddField("营业执照编号", "license_no", db.Varchar, form.Text)
	formList.AddField("营业执照名称", "license_name", db.Varchar, form.Text)
	formList.AddField("营业执照照片", "license_pic", db.Varchar, form.Text)
	formList.AddField("营业执照有效期", "license_valid_date", db.Varchar, form.Text)
	formList.AddField("门头照", "out_door_pic", db.Varchar, form.Text)
	formList.AddField("特殊资质照片", "special_license_pic", db.Varchar, form.Text)

	formList.SetTable("alipay_mini_app").SetTitle("支付宝小程序信息").SetDescription("支付宝小程序信息")

	return
}
